package com.seu.vcampus.vo;

import java.io.Serializable;
import java.util.Date;

/**
 * 用户值对象
 * 表示系统中的用户账户信息
 * 
 * @author 虚拟校园开发团队
 * @since 1.0.0
 */
public class User implements Serializable {
    private static final long serialVersionUID = 1L;
    
    private String userId;
    private String username;
    private String password;
    private String email;
    private String phone;
    private UserType userType;
    private Date createTime;
    private Date lastLogin;
    private boolean isActive;
    
    public enum UserType {
        STUDENT, TEACHER, ADMIN,
        LIBRARY_ADMIN,    // 图书馆管理员
        SYSTEM_ADMIN,     // 系统管理员
        FINANCE_ADMIN     // 财务管理员
    }
    
    public User() {}
    
    public User(String userId, String username, String password, UserType userType) {
        this.userId = userId;
        this.username = username;
        this.password = password;
        this.userType = userType;
        this.createTime = new Date();
        this.isActive = true;
    }
    
    // Getters and Setters
    public String getUserId() { return userId; }
    public void setUserId(String userId) { this.userId = userId; }
    
    public String getUsername() { return username; }
    public void setUsername(String username) { this.username = username; }
    
    public String getPassword() { return password; }
    public void setPassword(String password) { this.password = password; }
    
    public String getEmail() { return email; }
    public void setEmail(String email) { this.email = email; }
    
    public String getPhone() { return phone; }
    public void setPhone(String phone) { this.phone = phone; }
    
    public UserType getUserType() { return userType; }
    public void setUserType(UserType userType) { this.userType = userType; }
    
    public Date getCreateTime() { return createTime; }
    public void setCreateTime(Date createTime) { this.createTime = createTime; }
    
    public Date getLastLogin() { return lastLogin; }
    public void setLastLogin(Date lastLogin) { this.lastLogin = lastLogin; }
    
    public boolean isActive() { return isActive; }
    public void setActive(boolean active) { isActive = active; }
    
    @Override
    public String toString() {
        return "User{" +
                "userId='" + userId + '\'' +
                ", username='" + username + '\'' +
                ", userType=" + userType +
                '}';
    }
}